package com.itheima.a02staticdemo2;

public class ArrayUtil {

    private ArrayUtil() {}

    public static String printArr(int[] arr) {
        String str="[";
        for (int i = 0; i < arr.length; i++) {
            if(i==arr.length-1){
                str+=arr[i]+"]";
                break;
            }
            str+=arr[i]+",";
        }
        return str;
    }

    public static double getAerage(double[] arr) {
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        return sum/arr.length;
    }
}
